Thermal displacement correction device for machine tool

ABSTRACT

A thermal displacement correction device for a machine tool is provided with detection result determination unit configured to determine, based on an actual position and a reference position detected by position detection unit, whether or not the actual position is based on correct detection, correction error calculation unit configured to calculate a correction error in the actual position if it is determined that the result of detection is based on correct detection, and correction amount modification unit configured to modify a thermal displacement correction amount based on the correction error.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to a machine tool, and more particularly,to a thermal displacement correction device for the machine tool.

2. Description of the Related Art

Since a feed screw and a spindle of a machine tool are driven by amotor, they are expanded so that their mechanical positions change dueto heating of the motor, frictional heat generated by the rotation of abearing, and frictional heat from a contact portion between a ball screwand a ball nut of the feed screw. Thus, the relative positions of aworkpiece to be positioned and a tool are shifted. The change of themechanical positions due to heating hinders high-accuracy machining.

The displacement of the mechanical positions due to heating can beeliminated by using a technique in which a command position is correctedbased on a displacement or temperature detected by a displacement ortemperature sensor or a structure configured to apply an initial tensionto the feed screw without being influenced by thermal expansion.

The technique for correcting the command position can be roughlyclassified into two categories.

In one of these categories, an actual thermal displacement isperiodically detected for correction by using a touch probe, forexample. In the other category, correction is made in real time bypredicting a thermal displacement amount from a value detected by thesensor and the operating state of the machine tool. In these cases,accuracy and time are in a trade-off relationship. Accordingly, a methodis proposed in which the overall accuracy of correction is improved bysuitably detecting and modifying an actual thermal displacement amount,although the thermal displacement amount is basically predicted andcorrected in real time.

According to Japanese Patent Application Laid-Open No. 2002-18677, athermal displacement amount attributable to axial movement of a feedshaft is estimated for each of a finite number of sections into whichthe entire stroke of the feed shaft is divided. The distribution ofthermal displacements in individual positions of a feed screw can beestimated by adding up the thermal displacement amounts for the sectionsfrom a reference position to a correction position. Thus, accuratecorrection can be made without regard to the position of the feed shaft.In addition, the thermal displacement can be accurately corrected inconsideration of a thermal displacement due to heating of a spindle orspindle motor. Furthermore, more accurate correction is made bymodifying a heating factor in a thermal displacement amount calculationformula, based on a deviation (correction error) between an estimatedthermal displacement amount (correction amount) and an actual mechanicalposition.

According to Japanese Patent Application Laid-Open No. 2012-101330, aninitial position is stored in advance by a position detection sensor anda position in which the next signal is output is detected as an actualposition. An error correction factor is calculated based on thedifference between the initial position and the detected actualposition, whereby a thermal displacement amount is modified. Correctionis made also in consideration of a change in ambient temperature orother thermal displacements irrelevant to machine operation.

According to Japanese Patent Application Laid-Open No. 11-90779, athermal displacement amount is measured after the drive of a machinetool is started, and a calculated value of a thermal displacementcorrection amount is modified based on the measured value. Specifically,a difference obtained by subtracting the calculated value from themeasured value or the ratio between the measured and calculated valuesis calculated as a correction value, and the thermal displacement amountis modified by adding the correction value to the calculated value ormultiplying the calculated value by the correction value. An accuratethermal displacement amount can be calculated depending on variousproperties of the machine tool and the operating environment bymodifying the calculated value of the thermal displacement amount basedon the measured value.

According to Japanese Patent Applications Laid-Open Nos. 2002-18677,2012-101330, and 11-90779, if chips are caught or a coolant splashes sothat the result of detection by a position detection sensor is improper,a factor or thermal displacement correction amount may possibly bemodified by mistake so that the result of correction becomes worse.

Disclosed in Japanese Patent Application Laid-Open No. 2002-18677,moreover, is the method for modifying the heating factor in the thermaldisplacement amount calculation formula based on the correction error.Since the calculation formula includes other factors or coefficients (aheat radiation coefficient and a heat conduction coefficient forcalculating heat conduction from each adjacent section), the accuracy ofthe correction sometimes cannot be further improved by only modifyingthe heating factor.

In the technique disclosed in Japanese Patent Application Laid-Open No.11-90779, moreover, the measured value of the thermal displacementamount is calculated by comparing a calculated drive amount with a driveamount obtained before a tool contacts a detector. If the calculateddrive amount is different from the latter due to deformation of a columnor the like, therefore, a problem remains that the thermal displacementcannot be satisfactorily corrected.

SUMMARY OF THE INVENTION

Accordingly, the object of the present invention is to provide a thermaldisplacement correction device for a machine tool, configured to performre-detection if the result of detection by a position detection sensoris improper and modify a thermal displacement correction amount based onan accurately detected measured value of a thermal displacement amount(measured thermal displacement amount), thereby making correction alsoin consideration of a change in ambient temperature or other thermaldisplacements irrelevant to machine operation.

A thermal displacement correction device for a machine tool isconfigured to calculate a thermal displacement amount of the machinetool, set an amount for canceling the thermal displacement amount as athermal displacement correction amount, and add the thermal displacementcorrection amount to a position command for a feed shaft, thereby makingcorrection, and comprises a position detection unit configured to detecta position of a movable part of the machine tool, a reference positionstorage unit configured to store the result of detection by the positiondetection unit at a first point in time as a reference position, anactual position storage unit configured to store the result of detectionby the position detection unit at a second point in time as an actualposition, a detection result determination unit configured to determine,based on the actual position and the reference position, whether or notthe actual position is based on correct detection, a re-detection unitconfigured to re-detect the position detected by the position detectionunit if it is determined by the detection result determination unit thatthe detection result is not based on correct detection, a correctionerror calculation unit configured to compare the thermal displacementamount with an actual thermal displacement amount calculated from adifference between the actual position and the reference position andcalculate a correction error in the actual position if it is determinedby the detection result determination unit that the detection result isbased on correct detection, and a correction amount modification unitconfigured to modify the thermal displacement correction amount based onthe correction error calculated by the correction error calculationunit.

The detection result determination unit may be configured to determinethe detection result to be based on correct detection if the differencebetween the actual position and the reference position is within athreshold value. Such an effect is obtained that it can be determinedwhether or not a detected value is based on correct measurement.

The threshold value may be obtained by addition of the thermaldisplacement amount. Such an effect is obtained that the threshold valueneed not be increased even in machining with large thermal displacementand false detection can be reduced.

The re-detection unit may be configured to perform detection aftershifting a position of detection if it is determined by the detectionresult determination unit that the detection result is not based oncorrect detection. Such an effect is obtained that re-detection can beachieved even if chips are caught and prevent correct detection.

The correction amount modification unit may be configured to obtain anerror correction factor from the ratio of the correction error to athermal displacement amount in the actual position and increase ordecrease the thermal displacement amount by multiplying or dividing thethermal displacement amount by the error correction factor. Such aneffect is obtained that the correction amount can be modified by aratio.

The correction amount modification unit may be configured to add orsubtract a value, obtained by subtracting the thermal displacementamount in the actual position from the correction error in the actualposition, to or from the thermal displacement amount, to increase ordecrease the thermal displacement amount. Such an effect is obtainedthat the correction amount can be modified by a difference.

According to the present invention configured as described above, therecan be provided a thermal displacement correction device for a machinetool, configured to perform re-detection if the result of detection by aposition detection sensor is improper and modify a thermal displacementcorrection amount based on an accurately detected measured thermaldisplacement amount, thereby making correction also in consideration ofa change in ambient temperature or other thermal displacementsirrelevant to machine operation.

BRIEF DESCRIPTION OF THE DRAWINGS

The above and other objects and features of the present invention willbe obvious from the ensuing description of embodiments with reference tothe accompanying drawings, in which:

FIG. 1 is a view showing an example of the installation position of aposition detection sensor;

FIG. 2 is a block diagram showing a principal part of a numericalcontroller for controlling a machine tool;

FIG. 3 is a diagram illustrating section setting;

FIG. 4 is a flowchart showing processing for thermal displacementcorrection;

FIG. 5 is a flowchart showing processing for calculating a thermaldisplacement amount;

FIG. 6 is a flowchart showing processing for calculating an errorcorrection factor E;

FIGS. 7A and 7B are diagrams for illustrating equation (3); and

FIGS. 8A and 8B are diagrams for illustrating equations (4) and (5).

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

A method of detecting the position of a feed shaft will be describedfirst.

1. <Position Detection Sensor (for Detection of Feed Shaft Position)>

FIG. 1 is a schematic view showing an example of the installationposition of a position detection sensor 1. As shown in FIG. 1, theposition detection sensor 1 is held on a spindle 2 and generates acontact signal when it is brought into contact with a jig 5 or aworkpiece 4 fixed on a table 3. For example, a touch probe (ortouch-type probe) is used as the position detection sensor 1. Since thetouch probe also moves as the feed shaft of a machine tool moves, it canmake detection from an optimal position and in an optimal direction.

The position detection sensor 1 is not limited to the touch probedescribed above, and may alternatively be a contact-type positiondetection switch such as a limit switch, microswitch, etc., or anon-contact position detection switch such as a magnetic detectionswitch, inductive proximity switch, capacitive proximity switch, etc.

For the installation position, moreover, a detection head may be set ona stationary part of a machine body, and a magnetism generating body maybe mounted on a movable part of the machine body. The stationary partmay be, for example, a bed, column, or saddle of the machine tool, whichis immovable relative to each feed shaft. The movable part may be, forexample, a spindle head, table, saddle, or nut in threaded engagementwith one of the feed shafts, which is movable along each feed shaft.

FIG. 2 is a functional block diagram showing a principal part of anumerical controller for the machine tool. A processor (CPU) 11 of anumerical controller 10 serves to totally control the numericalcontroller 10. The processor 11 reads a system program stored in a ROM12 through a bus 21, and totally controls the numerical controller 10 inaccordance with the read system program. A RAM 13 is stored withtemporary calculation data, display data, and various data input by anoperator through an LCD/MDI unit 70.

An SRAM 14 is constructed as a nonvolatile memory that is backed up by abattery (not shown) so that it can maintain its storage state even afterthe numerical controller 10 is powered off. The SRAM 14 can be storedwith a program for the measurement of an initial position, program forthermal displacement correction of the machine tool, machining program(described later) read through an interface 15, machining program inputthrough the LCD/MDI unit 70, and other programs. Further, the ROM 12 ispreloaded with various system programs for the execution of edit-modeprocessing required for the creation and editing of the machiningprogram and processing for automatic operation.

The interface 15 serves for external equipment that can be connected tothe numerical controller 10 and is connected with an external device 72,such as an external storage device. The machining program, thermaldisplacement measurement program, and other programs are read from theexternal storage device. A programmable machine controller (PMC) 16controls auxiliary devices or the like on the machine tool side bysequential programs in the numerical controller 10. Necessary signals onthe auxiliary device side are converted according to these sequentialprograms based on M-, S-, and T-functions commanded by the machiningprogram. The converted signals are output to the auxiliary device sidethrough an I/O unit 17. The various auxiliary devices, e.g., actuators,are activated by these output signals. When signals are received fromvarious switches of a control panel on the machine tool body, moreover,they are processed as required and delivered to the processor 11.

Image signals indicative the current position of each axis of themachine tool, alarms, parameters, image data, etc., are delivered to theLCD/MDI unit 70 and displayed on its display. The LCD/MDI unit 70 is amanual data input device provided with a display, keyboard, etc. Aninterface 18 receives data from the keyboard of the LCD/MDI unit 70 anddelivers it to the processor 11.

An interface 19 is connected to a manual pulse generator 71. The manualpulse generator 71 is mounted on the control panel of the machine tooland used to precisely position movable parts of the machine tool byeach-axis control with distributed pulses based on manual operation. X-,Y-, and Z-axis control circuits 30 to 32 for moving a table T of themachine tool receive move commands from the individual axes from theprocessor 11 and output the commands to servo amplifiers 40 to 42,respectively. On receiving these commands, the servo amplifiers 40 to 42drive servomotors 50 to 52 for the individual axes of the machine tool,respectively. Pulse coders for position detection are incorporated inthe servomotors 50 to 52, individually. Position signals from thesepulse coders are fed back as pulse trains.

A spindle control circuit 60 receives a spindle rotation command for themachine tool and outputs a spindle speed signal to a spindle amplifier61. On receiving this spindle speed signal, the spindle amplifier 61rotates a spindle motor 62 of the machine tool at a commanded rotationalspeed, thereby driving a tool. A position coder 63 is coupled to thespindle motor 62 by gears, a belt, or the like. The position detector 63outputs feedback pulses in synchronism with the rotation of the spindle,and the feedback pulses are read through an interface 20 by theprocessor 11. Numeral 65 denotes a clock circuit adjusted so as tosynchronize with the current time. Processing of the flowchart describedbelow is performed by the numerical controller 10.

The following is a description of an embodiment.

2. <Estimation and Correction of Thermal Displacement Amount>

2.1<Section Setting>

Calculation and correction of a thermal displacement amount will bedescribed first. The thermal displacement amount of the feed shaft isestimated by the same method as that disclosed in Japanese PatentApplication Laid-Open No. 2002-18677. First, as shown in FIG. 3, theentire length (stroke) of a feed screw 8 constituting the feed shaft isdivided into a plurality of sections (Sections 0 to X) set with theposition of a fixed bearing as a reference position 7.

The entire length of the feed screw 8 is assumed to cover a movablerange from the end face of the fixed bearing on the side of a nut 6, asa reference position, to the end face on the side at least farther fromthe reference position of the nut 6. The entire length of the feed screw8 is divided into a finite number of sections, the section adjacent tothe reference position is assumed to be Section 0, and the sectionfarthest from the reference position is assumed to be Section X.

As for a thermal displacement amount (hereinafter referred to as“feed-shaft-section thermal displacement amount”) in Position X causedby thermal displacement of the feed shaft when the entire length of thefeed screw 8 is divided into a number, X, of sections, afeed-shaft-section thermal displacement amount LnX for Section X at Timen can be obtained by adding up the thermal displacement amounts for theindividual sections from the reference position 7 to Section X, asindicated by equation (1) as follows:

LnX=δn0+δn1+ . . . +δnI+ . . . +δnX,  (1)

where δnI is a thermal displacement amount for Section I (arbitrarysection) and LnX is the feed-shaft-section thermal displacement amountin Section X at time n.

2.2<Correction of Thermal Displacement>

The following is a description of correction of thermal displacement.The thermal displacement is corrected for each predetermined shortperiod (e.g., for each 4 ms) with reference to the flowchart of FIG. 4.First, the position of the feed shaft is detected and stored into thememory. A modified feed-shaft-section thermal displacement amount LnI′for a section (Section I) corresponding to the detected position of thefeed shaft is read from the memory and an amount for canceling it isassumed to be a thermal displacement correction amount. Thus, themodified feed-shaft-section thermal displacement amount LnI′ isnegatively equal to the thermal displacement correction amount.Accordingly, the correction is made by adding the thermal displacementcorrection amount to a position command for the feed shaft.

The following is a sequential description of various steps of operationshown in the flowchart of FIG. 4.

[Step SA01] The position of the feed shaft is detected and stored intothe memory.

[Step SA02] The modified feed-shaft-section thermal displacement amountLnI′ for Section I corresponding to the detected position is read fromthe memory. The modified feed-shaft-section thermal displacement amountLnI′ will be described later.

[Step SA03] The amount for canceling the modified feed-shaft-sectionthermal displacement amount LnI′ is assumed to be the thermaldisplacement correction amount and delivered to a correction unit.

[Step SA04] Correction is made, whereupon the processing ends.

2.3<Calculation of Thermal Displacement Amount>

The thermal displacement amount is calculated for each predeterminedperiod (e.g., for each second) in the manner shown in the flowchart ofFIG. 5. The following is a sequential description of various steps ofoperation shown in the flowchart of FIG. 5.

[Step SB01] The position of the feed shaft stored in the memory in theprocessing of FIG. 4 is read for the past one second from the memory.

[Step SB02] An average moving speed in each section is obtained from theposition of the feed shaft read from the memory.

[Step SB03] The thermal displacement amount for each section is obtainedfrom the average movement speed in each section and stored into thenonvolatile memory.

[Step SB04] A feed-shaft-section thermal displacement amount LnI foreach section is obtained by adding up the thermal displacement amountsfor the individual sections from the reference position to each sectionbased on equation (1) and stored into the memory. For example, thememory is stored with Ln 0=δn0 as a feed-shaft-section thermaldisplacement amount for Section 0, Ln 1=δn0+δn1 as a feed-shaft-sectionthermal displacement amount for Section 1, and Ln 2=δn0+δn1+δn2 as afeed-shaft-section thermal displacement amount for Section 2.

[Step SB05] The feed-shaft-section thermal displacement amount LnI foreach section and an error correction factor E are read from the memory.

[Step SB06] Based on the feed-shaft-section thermal displacement amountLnI and the error correction factor E, the modified feed-shaft-sectionthermal displacement amount LnI′ obtained by the modification of thefeed-shaft-section thermal displacement amount by equation (2) is storedinto the memory for each section, whereupon the processing ends.

LnI′=LnI·E.  (2)

2.4<Calculation of Error Correction Factor E>

The following is a description of a method of calculating the errorcorrection factor E. The error correction factor E is calculated as theoperator issues a command at an arbitrary timing in the machiningprogram using an M-code or inputs a detected value to its dedicatedscreen at an arbitrary timing after machining. This calculation isperformed with reference to the flowchart of FIG. 6. The following is asequential description of various steps of operation shown in theflowchart of FIG. 6.

[Step SC01] A decision is made on the next processing in response to thecommand based on the M-code. If the reference position is commanded byan argument, the processing proceeds to Step SC02. If an actual positionis commanded by an argument, the processing proceeds to Step SC04. Ifmodification of the error correction factor is commanded by an argument,the processing proceeds to Step SC07. The determination of conditions isnot limited to the commanding based on the M-code and may be executed oncondition that a cursor is moved to each item provided on a dedicatedscreen.

[Step SC02] The measurement program is executed to cause the positiondetection sensor to detect the reference position. Alternatively, theoperator manually moves the feed shaft to cause the position detectionsensor to detect the reference position and inputs the detected value tothe dedicated screen.

[Step SC03] A detected value X₁ in the reference position is stored intothe nonvolatile memory. This reference position may or may not besubjected to thermal displacement correction before the storage. Whenthe storage is completed, the processing ends.

[Step SC04] The measurement program is executed to cause the positiondetection sensor to detect the actual position. The same positioncommand for the detection of the reference position is used for thedetection of the actual position. Alternatively, the operator manuallymoves the feed shaft to cause the position detection sensor to detectthe actual position and inputs the detected value to the dedicatedscreen.

[Step SC05] It is determined whether a difference |X₂−X₁| betweendetected values X₂ and X₁ in the actual and reference positions is notlarger than a threshold value T. If the difference is not larger thanthe threshold value T, the processing proceeds to Step SC06. If thedifference is larger than the threshold value T, the processing proceedsto Step SC04, whereupon the measurement program is performed again (forre-detection).

The threshold value T includes the thermal displacement amount, asindicated by equation (3). In this equation, α and β are preset factors.The factor α is determined depending on the size of chips, while thefactor β represents the inaccuracy of the thermal displacementcorrection. If the thermal displacement correction is not accomplished,1 is loaded into β. If the thermal displacement correction isaccomplished with little environmental change, a value close to 0 isloaded into β. Further, LnS₂ is a thermal displacement amount in asection (Section S₂) to which the detected actual position belongs.

T=α+β·LnS ₂.  (3)

The significance of equation (3) will be described with reference toFIGS. 7A and 7B. Numeral 100 designates a graph prepared by plotting theelapsed time for |X₂−X₁|. The difference |X₂−X₁| varies as the thermaldisplacement is changed by machining. Chips are caught and cause |X₂−X₁|to suddenly increase when values denoted by numerals 101 and 102 in thisgraph are detected, and false values should preferably be identified atthese points in time of detection. FIG. 7A shows a case where thethreshold value is constant. If the threshold value is set so that thevalue 102 is determined to be false, the value 101 is not identified. Ifthe threshold value is set so that the value 101 is determined to befalse, in contrast, a false value is inevitably identified despitenormal detection. FIG. 7B shows a case where the threshold valueincludes the thermal displacement amount. Since the threshold valuechanges in agreement with the thermal displacement, both the values 101and 102 can be determined to be false.

In order to keep away from chips during the re-detection, the positionof detection is shifted by adding a preset value γ to a command positionin the measurement program. The value γ is determined depending on thesize of the chips.

[Step SC06] The detected value X₂ in the actual position, the unmodifiedthermal displacement amount LnS₂ in Section S₂ to which the detectedactual position belongs, and an error correction factor E₂ are storedinto the nonvolatile memory. This actual position may or may not besubjected to thermal displacement correction before the storage. If thethermal displacement correction is not accomplished, 0 is stored intothe nonvolatile memory for the error correction factor E₂. When thestorage is completed, the processing ends.

Normally, modification of the error correction factor is orderedimmediately after the detection of the actual position is finished.

[Step SC07] The detected value X₁ in the reference position, detectedvalue X₂ in the actual position, thermal displacement amount LnS₂, anderror correction factor E₂ are read from the nonvolatile memory.

[Step SC08] A correction error ε in the actual position is obtained byequation (4) based on the difference between the detected values X₂ andX₁ in the actual and reference positions, in consideration of thethermal displacement amount, as follows:

ε=X ₂ −X ₁ +LnS ₂ ·E ₂.  (4)

[Step SC09] A modified error correction factor E′ is obtained byequation (5) based on the thermal displacement amount LnS₂ and thecorrection error ε in the actual position, as follows:

E′=ε/LnS ₂.  (5)

The significance of equations (4) and (5) will be described withreference to FIGS. 8A and 8B. For simplicity, let us assume that thedetected value X₁ in the reference position and a thermal displacementamount LnS₁ in Section S₁ to which the detected reference positionbelongs are 0 and the error correction factor E₂ in the actual positionis 1. A graph 103 is assumed to be obtained by plotting detected values.Since the detected values are values obtained after correction by athermal displacement amount denoted by numeral 105, the actual thermaldisplacement amount can be represented by a graph 104. In particular,the actual thermal displacement amount in the actual position is thecorrection error E in equation (4). According to equation (5), themodified error correction factor E′ is obtained such that a modifiedthermal displacement amount LnS₂·E′ in the actual position is equal tothe correction error ε.

[Step SC10] The modified error correction factor E′ obtained in StepSC09 is stored as a new error correction factor E into the nonvolatilememory, whereupon the processing end.

Since the error correction factor E is updated based on the measuredthermal displacement amount detected by the position detection sensor asin Step SC09, high-accuracy correction can be achieved also inconsideration of a change in ambient temperature or other thermaldisplacements irrelevant to machine operation.

The touch probe mounted on the spindle can be used to detect deformationof castings due to heating of the spindle, including tilting of aspindle mount or a column. Therefore, a value based on addition of thethermal displacement amount, as well as the feed-shaft-section thermaldisplacement amount LnI, may be used in the calculation of the thermaldisplacement amount and the like in Items 2.2 and 2.3.

In Item 2.4, moreover, the error correction factor E is calculated fromthe correction error ε and the thermal displacement amount LnS₂ in theactual position, as indicated by equation (5). Alternatively, however,the error correction factor E may be calculated from a difference, asindicated by equation (6) as follows:

E′=ε−LnS ₂.  (6)

In this case, equation (2) in Item 2.3 is replaced by equation (7) asfollows:

LnI′=LnI+E.  (7)

If the difference |X₂−X₁| between the detected values X₁ and X₂ in thereference and actual positions is larger than the threshold value, analarm may be generated to stop the automatic operation. If thedifference is larger than the threshold value in any of cycles ofre-detection repeated at a preset frequency, moreover, an alarm may begenerated to stop the automatic operation. If no chips are caught at thedetection position and if the position detection sensor has no problem,the operator can determine that the possibility of the detected value inthe reference position not being based on correct detection is high.

At the time of the re-detection, it is highly possible that accuratedetection can be performed even in the same position as chips aretouched by the touch probe and fall. However, the possibility ofaccurate detection can be further increased by using the method ofshifting the detection position. Alternative re-detection methodsinclude a method in which a coolant and air are discharged into thedetection position, a method in which a position detection sensor basedon a different detection mechanism is used as an alternative, and amethod in which the detection position is shifted from the jig side by,for example, rotating a cylindrical jig on an additional shaft.

According to the embodiment described above, the thermal displacementcorrection amount is modified based on the measured thermal displacementamount. Thus, an accurate thermal displacement correction amount can becalculated also in consideration of a change in ambient temperature,various properties of the machine tool, or other thermal displacementsirrelevant to machine operation.

The thermal displacement amount is corrected based on the predictionfrom the operating state of the machine tool. Thus, accurate correctioncan be made in real time by only detecting the thermal displacement atkey points where the ambient environment changes, not by periodicallydetecting the thermal displacement by the position sensor and extendingthe machining time.

Further, the detection in the reference position can be performed at anarbitrary timing and the thermal displacement correction amount can bemodified based on an arbitrary machine state. For example, the thermaldisplacement occurs due to a change in ambient temperature or the likeeven without machining, so that the influence of the thermaldisplacement having occurred before the machining can be reduced bydetecting the reference position immediately before the machining.

Furthermore, the thermal displacement correction amount can be modifiedby using an accurate detected value. In identifying a false value by athreshold value, the detected value is changed by the thermaldisplacement. Although it is difficult to determine a constant thresholdvalue, therefore, the threshold value can be set to a constant valueaccording to the above-described embodiment. If the false value isidentified, re-detection is performed after shifting the detectionposition. Even when chips are caught, therefore, the possibility ofaccurate detection being achieved next time is high.

1. A thermal displacement correction device for a machine tool,configured to calculate a thermal displacement amount of the machinetool, set an amount for canceling the thermal displacement amount as athermal displacement correction amount, and add the thermal displacementcorrection amount to a position command for a feed shaft, thereby makingcorrection, the thermal displacement correction device comprising: aposition detection unit configured to detect a position of a movablepart of the machine tool; a reference position storage unit configuredto store the result of detection by the position detection unit at afirst point in time as a reference position; an actual position storageunit configured to store the result of detection by the positiondetection unit at a second point in time as an actual position; adetection result determination unit configured to determine, based onthe actual position and the reference position, whether or not theactual position is based on correct detection; a re-detection unitconfigured to re-detect the position detected by the position detectionunit if it is determined by the detection result determination unit thatthe detection result is not based on correct detection; a correctionerror calculation unit configured to compare the thermal displacementamount with an actual thermal displacement amount calculated from adifference between the actual position and the reference position andcalculate a correction error in the actual position if it is determinedby the detection result determination unit that the detection result isbased on correct detection; and a correction amount modification unitconfigured to modify the thermal displacement correction amount based onthe correction error calculated by the correction error calculationunit.
 2. The thermal displacement correction device for a machine toolaccording to claim 1, wherein the detection result determination unitdetermines the detection result to be based on correct detection if thedifference between the actual position and the reference position iswithin a threshold value.
 3. The thermal displacement correction devicefor a machine tool according to claim 2, wherein the threshold value isobtained by using the thermal displacement amount.
 4. The thermaldisplacement correction device for a machine tool according to claim 1,wherein the re-detection unit is configured to perform detection aftershifting a position of detection if it is determined by the detectionresult determination unit that the detection result is not based oncorrect detection.
 5. The thermal displacement correction device for amachine tool according to claim 1, wherein the correction amountmodification unit is configured to obtain an error correction factorfrom the ratio of the correction error to a thermal displacement amountin the actual position and increase or decrease the thermal displacementamount by multiplying or dividing the thermal displacement amount by theerror correction factor.
 6. The thermal displacement correction devicefor a machine tool according to claim 1, wherein the correction amountmodification unit is configured to add or subtract a value, obtained bysubtracting the thermal displacement amount in the actual position fromthe correction error in the actual position, to or from the thermaldisplacement amount, to increase or decrease the thermal displacementamount.